package com.r2coding.system.dao;

import com.r2coding.system.entity.RoleEntity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.r2coding.system.model.UserRoleModel;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 
 * 
 * @author 98k灬
 * @email hk666zx@163.com
 * @date 2022-04-04 11:10:29
 */
@Mapper
public interface RoleDao extends BaseMapper<RoleEntity> {

    void addUserRole(UserRoleModel userRoleModel);

    void removeUserRole(UserRoleModel userRoleModel);

    void deleteByUserId(@Param("userId") Integer userId);

    List<UserRoleModel> getByRoleId(@Param("roleId") Integer roleId);

    RoleEntity selectByRoleName(@Param("roleName") String roleName);

    void updateRoleById(RoleEntity roleEntity);
}
